﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace ScotiabankWP7.Forms.PagoServicios
{
    public partial class SeleccionaPagoPendiente : PhoneApplicationPage
    {
        string indice = "";

        public SeleccionaPagoPendiente()
        {
            InitializeComponent();

            txtCompraVenta.Text = "TC: Compra = S/. 2.7965 Venta = S/. 2.8035";
            txtFecha.Text = "18/02/2001 18:50:52";

        }

        private void setLabelReferencia(string indice)
        {
            if (indice.Equals("0"))
            {
                NroReferencia.Text = "N° Suministro";
            }
            else if (indice.Equals("1"))
            {
                NroReferencia.Text = "N° Telefónico";
            }
            else if (indice.Equals("2"))
            {
                NroReferencia.Text = "N° Referencia";
            }
            else if (indice.Equals("3"))
            {
                NroReferencia.Text = "N° Telefónico";
            }
        }

        private void btnPagar_Click(object sender, RoutedEventArgs e)
        {

            PhoneApplicationFrame root = Application.Current.RootVisual as PhoneApplicationFrame;

            if (indice.Equals("0"))
            {
                root.Navigate(new Uri("/Forms/PagoServicios/ConfirmacionPagoAguaLuzGas.xaml", UriKind.Relative));
            }
            else if (indice.Equals("1"))
            {
                root.Navigate(new Uri("/Forms/PagoServicios/ConfirmacionPagoTelfCableInternet.xaml", UriKind.Relative));
            }
            else if (indice.Equals("2"))
            {
                root.Navigate(new Uri("/Forms/PagoServicios/ConfirmacionPagoInstitucion.xaml", UriKind.Relative));
            }
            else if (indice.Equals("3"))
            {
                root.Navigate(new Uri("/Forms/PagoServicios/ConfirmacionPagoFrecuente.xaml", UriKind.Relative));
            }

        }


        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            indice = NavigationContext.QueryString["indice"];
            base.OnNavigatedTo(e);
            setLabelReferencia(indice);
        }
    }
}